cd $FOLDER_PATH
###echo FOLDER_PATH is $FOLDER_PATH
if [ "$1" = "" ] ; then
	echo "Drag the script you wish to convert onto this icon"
fi
echo "Each script will be made executable, given the type 'text/x-script.xicon'"
echo -e "with Preferred App 'xicon' It will accept *any* files dropped on it as args.\n"
for x; do {
  echo Attributes of:
  listattr "$x"
  if listattr "$x"|grep -q BEOS:TYPE ; then
	echo -e "\n It is currently of type:   " `catattr BEOS:TYPE "$x"|cut --delimiter : --fields 3`
  else
	echo -e "\n $x has no type attribute set"
  fi
  if listattr "$x"|grep -q BEOS:PREF_APP ; then
        echo -e " the preferred app is:   " `catattr BEOS:PREF_APP "$x"|cut --delimiter : --fields 3`
  else
	echo it has no current preferred application
  fi
  
  echo -en "\nREALLY force '$x' to be a Xicon Terminal Script ?"
  read
  case $REPLY in
        y*) chmod +x "$x"
	    if [ -e /bin/copyattr ] ; then
		# this must be R3 or later -- needs BEOS:FILE_TYPES set
		# -- use ourselves as a template...
		copyattr "$0" "$x"
	    else
		# This must be R2 (or earlier?!)
		rmattr BEOS:TYPE "$x"
		addattr BEOS:TYPE "text/x-script.xicon" "$x"
		rmattr BEOS:PREF_APP "$x"
		addattr BEOS:PREF_APP "application/x-xicon" "$x"
	    fi
            echo "after adjustment..."
            listattr "$x"
            echo -e "\nNow of type:   " `catattr BEOS:TYPE "$x"|cut -d : -f 3`
            echo -e " with preferred app:   " `catattr BEOS:PREF_APP "$x"|cut --delimiter : --fields 3`
        ;;
        *) 
        ;;
  esac
 
  echo -e "=====================\n\n"
} ;done
echo "All done"
read
